﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RequestServiceTicket.aspx.vb" Inherits="RequestServiceTicket" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>
    <script type="text/javascript" src="js/cufon-yui.js"></script>
    <script type="text/javascript" src="js/arial.js"></script>
    <script type="text/javascript" src="js/cuf_run.js"></script>
    <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .hdr
    {
        background-color: #C0C0C0;
        padding:5px;
        font-weight:bold;
    }
    </style>
    <script type="text/javascript">
        if (window.name.length<=0) {
            window.location = "Login.aspx";
        } else {

        }

        function openLoginPage() {

        }
    </script>
    <script type="text/javascript">
        
        $(document).ready(function () {
            Page.Init();
        });
        
        var Page = {};
        Page.Init = function () {
            //$("#btnSubmit").attr("disabled", "disabled");
            // $("#txtUserName").blur(Page.CheckUsername);
            $("#txtSubject").blur(Page.CheckSubject);
            $("#txtDescription").blur(Page.CheckDescription);
            $.fancybox.resize();
        }
        Page.Fields = {};
        Page.Fields.UserName = true;
        Page.Fields.Subject = false;
        Page.Fields.Description = false;

        Page.Close = function () {
            window.parent.$.fancybox.close()
        }
        Page.Validate = function () {
            if ( Page.Fields.Subject && Page.Fields.Description) {

                $("#btnSubmit").removeAttr("disabled")
            } else {
                $("#btnSubmit").attr("disabled", "disabled")
            }
        }
        Page.CheckUsername = function () {
            var uname = $("#txtUserName").val();
            if (uname != "" || uname == undefined) {
                Page.Fields.UserName = true;
                $("#txtUserName_err").hide();
            } else {
                Page.Fields.UserName = false;
                $("#txtUserName_err").show();
            }
            Page.Validate();
        }

        Page.CheckSubject = function () {
            var usubject = $("#txtSubject").val();
          
            if (usubject != "" || usubject == undefined) {
                Page.Fields.Subject = true;
                $("#txtSubject_err").hide();
            } else {
                Page.Fields.Subject = false;
                $("#txtSubject_err").show();
            }
            Page.Validate();
        }

        Page.CheckDescription = function () {
           
            var udescription = $("#txtDescription").val();
           
            if (udescription != "" || udescription == undefined) {
                Page.Fields.Description = true;
                $("#txtDescription_err").hide();
            } else {
                Page.Fields.Description = false;
                $("#txtDescription_err").show();
            }
            Page.Validate();
        }
       

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField runat="server" ID="txtIniTime" />
    <asp:Panel ID="panelForm" runat="server">
    
    <div class="hdr">New Request</div>
<div>
    <table>
        <tr>
            <td width="100">Name</td>
            <td><asp:TextBox ID="txtUserName" runat="server" ReadOnly="True" Width="250px" ></asp:TextBox></td>
            
        </tr>
        <tr>
            <td width="100">Subject</td>
            <td><asp:TextBox ID="txtSubject" runat="server" Width="250px" ></asp:TextBox></td>
            <td class="regerrmsg" id="txtSubject_err">Please type a subject here.</td>
        </tr>
         <tr>
            <td width="100" style="vertical-align: top;">Description</td>
            <td><asp:TextBox ID="txtDescription" runat="server" Height="180px" Width="250px" 
                    TextMode="MultiLine" ></asp:TextBox></td>
            <td class="regerrmsg" id="txtDescription_err" style="vertical-align: top;">Please type a description here</td>
        </tr>
        <tr>
            <td width="100" style="vertical-align: top;">Service Type</td>
            <td>
                <asp:DropDownList ID="serviceType" runat="server" >
                        <asp:ListItem>Select</asp:ListItem>
                        <asp:ListItem>Home maintenance</asp:ListItem>
                        <asp:ListItem>Plumbing</asp:ListItem>
                        <asp:ListItem>Pest Control</asp:ListItem>
                        <asp:ListItem>Furniture work</asp:ListItem>
                        <asp:ListItem>Fixtures</asp:ListItem>
                        <asp:ListItem>Wiring</asp:ListItem>
                        <asp:ListItem>Fixtures</asp:ListItem>
                        <asp:ListItem>Painting</asp:ListItem>
                        <asp:ListItem>Plumbing</asp:ListItem>
                 </asp:DropDownList>
                 </td>
                 <td><asp:TextBox ID="errorServiceType" 
                         runat="server" ForeColor="#FF0000" Font-Names="arial" Width="210px" 
                         ReadOnly="True" Font-Size="Small" BackColor="White" BorderColor="White" 
                         BorderStyle="None">Please select a service type</asp:TextBox></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" /></td>
        </tr>
    </table>
</div>
</asp:Panel>
    
    <asp:Panel ID="panelMessage" runat="server" Visible="False">
    
<div class="regmessage">Thank you, your service ticket is registered successfully. customer care assistance will contact you soon.</div>
<div class="regmessage"><input type="button" value="Close" onclick="Page.Close()" /></div>
</asp:Panel>
 <asp:Panel ID="panelExist" runat="server" Visible="False">
    
<div class="regmessage">There is an error while creating your request ticket, Please contact our customer care.</div>
<div class="regmessage"><input type="button" value="Close" onclick="Page.Close()" /></div>
</asp:Panel>
    </form>
</body>
</html>
